package com.service.dao.enums;

import lombok.Getter;
import org.springframework.lang.Nullable;

/**
 * <dl>
 * <dt>back-end</dt>
 * <dd>Description:</dd>
 * <dd>Copyright: Copyright (C) 2015</dd>
 * <dd>Company: </dd>
 * <dd>CreateDate: 2019年11月30日</dd>
 * </dl>
 *
 * @author
 */
public enum HrComboTypeEnum {

    ORIGIN(1, "ORIGIN"),//期货产品
    CONTRACT(2, "CONTRACT"),//现货产品
    COMBINE(3, "COMBINE"),//联合产品
    COMBLOCK(4, "COMBLOCK"),//锁仓产品
    COMBEXPER(5, "COMBEXPER"),//体验产品
    HR_COMBO_DEPOSIT(6, "HR_COMBO_DEPOSIT"),
    HR_COMBO_POINTS(7,"HR_COMBO_POINTS");

    @Getter
    private Integer code;
    @Getter
    private String name;

    HrComboTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static HrComboTypeEnum valueOf(int statusCode) {
        HrComboTypeEnum status = resolve(statusCode);
        if (status == null) {
            throw new IllegalArgumentException("No matching constant for [" + statusCode + "]");
        }
        return status;
    }

    @Nullable
    public static HrComboTypeEnum resolve(int statusCode) {
        for (HrComboTypeEnum status : values()) {
            if (status.code == statusCode) {
                return status;
            }
        }
        return null;
    }
}
